package com.dysf.proxy.statically.impl;

import com.dysf.proxy.statically.IGamePlayer;
import org.springframework.stereotype.Component;

/**
 * @Description 代理类，与被代理类实现同一个接口
 * @Author dysfzl
 * @Date 2022-01-08 11:06
 * @Copyright xx科技有限公司 Copyright (c)
 * @Version 1.0
 */
@Component
public class GameProxyPlayer implements IGamePlayer {
    /**
     * 引入被代理对象
     */
    GamePlayer gamePlayer ;
    public GameProxyPlayer(){
        gamePlayer = new GamePlayer();
    }

    @Override
    public void start() {
        System.out.println("代理人准备登录了");
        gamePlayer.start();
    }

    @Override
    public void play() {
        gamePlayer.play();
        System.out.println("代理人帮我打赢了，真利害");
    }
}
